import QtQuick 2.0

Item {
    id: root
    property alias image: icon.source
    property alias text: msg.text
    property alias color: msg.color
    property bool started: false
    opacity: 0.0

    Image {
        id: icon
        anchors.centerIn: root
        height: root.height * 0.7
        fillMode: Image.PreserveAspectFit
    }

    Text {
        id: msg
        font.pointSize: 64
        anchors.horizontalCenter: root.horizontalCenter
        anchors.top: icon.bottom
    }

    function start()
    {
        anim.from = 0.0
        anim.to = 1.0
        anim.start()
        started = true
    }

    function stop()
    {
        anim.from = 1.0
        anim.to = 0.0
        anim.start()
        started = false
    }

    NumberAnimation on opacity {
        id: anim
        easing.type: Easing.Linear
        duration: 750
        running: false;
    }
}
